package sz.szsmk.citizencard.mvp.presenter;

import javax.inject.Inject;

import sz.szsmk.citizencard.model.network.GsdxNetApi;
import sz.szsmk.citizencard.mvp.contract.IBusHomeContact;
import sz.szsmk.citizencard.retrofitrxjava.NetworkDateSources;

/**
 * Copyright (c)2018
 * author: zdh
 * created on: 2018/12/28 18:48
 * description:
 */
public class BusHomePresenter extends IBasePresenter
        implements IBusHomeContact.IBusHomePresenter<IBusHomeContact.IBusHomeView> {

    private NetworkDateSources mNetworkDateSource;
    GsdxNetApi gsdxNetApi;

    @Inject
    public BusHomePresenter(GsdxNetApi gsdxNetApi) {
        this.gsdxNetApi = gsdxNetApi;

        this.mNetworkDateSource = NetworkDateSources.getInstance();
    }

    @Override
    public void queryBusLineNearby(String latitude, String longitude) {
//        QueryBusLineNearbyReq nearbyReq = new QueryBusLineNearbyReq();
//        nearbyReq.setLatitude(latitude);
//        nearbyReq.setLongitude(longitude);
//        mNetworkDateSource.queryBusLineNearby(nearbyReq, new SubscribeResult<QueryBusLineNearbyRes>() {
//            @Override
//            protected void onOk(QueryBusLineNearbyRes response) {
//                String json = new Gson().toJson(response);
//                L.e(Constant.TAG, "公交首页附近线路------" + json);
//                ((IBusHomeContact.IBusHomeView) mView).queryBusLineNearbySucc(response);
//            }
//
//            @Override
//            protected void onFailure(QueryBusLineNearbyRes response) {
//                super.onFailure(response);
//                Toast.makeText(DaggerApplication.getIns(), response.getMessage(), Toast.LENGTH_SHORT).show();
//            }
//        }, new ErrorAction() {
//            @Override
//            public void onCall(Throwable throwable) {
//
//            }
//        });

    }
}
